package indi.lddsdu.bean;

import indi.lddsdu.exception.RecordException;

/**
 * Created by jack on 18/6/10.
 */

//contentType | filePath | title  | url
public class Record {
    private static final String TEXT = "TEXT";
    private static final String IMAGE = "IMAGE";
    private String contentType;
    private String filePath;
    private String title;
    private String url;
    private boolean isText = false;

    public Record(String contentType, String filePath, String title, String url) throws RecordException {
        this.contentType = contentType;
        this.filePath = filePath;
        this.title = title;
        this.url = url;
        if (contentType == null){
            throw new RecordException();
        }
        if(TEXT.equals(contentType.trim())){
            isText = true;
        }
    }

    public static String getTEXT() {
        return TEXT;
    }

    public static String getIMAGE() {
        return IMAGE;
    }

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public boolean isText() {
        return isText;
    }

    public void setText(boolean text) {
        isText = text;
    }
}
